//1.导入http 模块
const http = require('http')
//创建服务
const server = http.createServer()

//3.监听客户端
server.on('request', (request, response) => {
    //中文  设置
    response.setHeader('content-type', 'text/html;charset=utf-8')
    //响应
    response.end('你好 world 2024')
})

//4启动服务
server.listen(3000, () => {
    console.log('server start')
})